﻿@{
    Layout = null;
}
@Content.Script(Url, "Manager/OrganizationalManage.js")

@* 机构管理 *@


<div class="mtlr15">
    <div class="row">
        <div class="col-lg-7 col-md-7 col-sm-7" style="padding:0">
            <button class="btn btn-success" onclick="$.MGJ.OrganizationalManage.Dialog_AddOrganizational()">
                <i class="glyphicon glyphicon-plus"></i>
                新增
            </button>
            @*<button class="btn btn-success">
                <i class="glyphicon glyphicon-arrow-down"></i>
                导入excel
            </button>*@
            <button class="btn btn-success" onclick="$.MGJ.OrganizationalManage.ExeclExpors('#OMID')">
                <i class="glyphicon glyphicon-share-alt"></i>
                导出excel
            </button>
        </div>

        <div class="col-lg-5 col-md-5 col-sm-5">
            <div class="input-group">
                <span class="input-group-addon" style="padding:0;border:none">
                    <select class="btn btn-default" id="OrganizationForm" onchange="$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo(1);"></select>
                    @*<select style="height:32px;" class="btn btn-default"   id="Etype" onchange="$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo(1);">
                        <option value="0">全部</option>
                        <option value="1">政府</option>
                        <option value="2">企业</option>
                        <option value="3">协会</option>
                        <option value="4">公众</option>
                        <option value="5">其它</option>
                        <option value="6">子单位</option>
                    </select>*@
                </span>
                <input id="Osearch" type="text" class="form-control" placeholder="机构名称" onkeydown="if (event.keyCode == 13) { $.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo(1); }" />
                <span class="input-group-addon" onclick="$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo(1);">
                    <span class="glyphicon glyphicon-search"></span>
                </span>
                @*<div class="input-group-btn" style="margin-left:1px;">
                    <button type="button" class="btn btn-default" style="border: 1px solid transparent;">
                        更多搜索
                        <span class="caret"></span>
                    </button>
                </div>*@
            </div>
        </div>
    </div>




    <div id="wh100">
        <div class="fixed-table">
            <div id="over">
                <div class="fixed-table-left">
                    <table>
                        <thead>
                            <tr>
                                <th><input class="AllClickCheckbox" type="checkbox"></th>
                                <th>机构代码</th>
                                <th>机构名称</th>
                            </tr>
                        </thead>
                        @*<tbody id="tableList_left" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.Dealer.Ajax_PageList'}">
                            <tr>
                                <td width="15"><input type="checkbox" class="AllClickChild" binding="{'ID':'ID'}"></td>
                                <td binding="{'text':'EnterpriseName','title':'EnterpriseName'}"> </td>
                            </tr>
                        </tbody>*@


                        <tbody id="OMID_left" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo'}">
                            <tr>
                                <td width="15"><input type="checkbox" class="AllClickChild" binding="{'ID':'ID'}"></td>
                                <td binding="{'text':'Code'}"></td>
                                <td binding="{'text':'EnterpriseName'}" data-toggle="tooltip"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-middle" style="width:100%;">
                    <table style="width:100%;">
                        <thead>
                            <tr>
                                <th width="30px"><input type="checkbox"></th>
                                <th class="empty">机构代码</th>
                                <th class="empty">机构名称</th>
                                <th class="text-center">机构类型/形式</th>
                                <th class="text-center">上级机构</th>
                                <th class="text-center">负责人</th>
                                <th class="text-center">负责人手机</th>
                                <th class="text-center">座机电话</th>
                                <th class="text-center">状态</th>
                                <th class="text-center">省市区</th>
                                <th class="text-center">地址</th>
                                <th class="text-center">操作时间</th>
                                <th class="text-center">操作</th>
                            </tr>
                        </thead>
                        <tbody id="OMID" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo','emptyHtml':OMID_EmptyHtml}">
                            <tr>
                                <td width="30px"><input type="checkbox"></td>
                                <td binding="{'text':'Code'}"></td>
                                <td binding="{'text':'EnterpriseName'}" data-toggle="tooltip"></td>
                                <td binding="{'text':'fName,tName','textFormat':'{0}/{1}'}"></td>
                                <td binding="{'text':'SuperiorsOrganizationName'}"></td>
                                <td binding="{'text':'PersonCharge'}"></td>
                                <td binding="{'text':'PersonMobile'}"></td>
                                <td binding="{'text':'LandlinePhone'}"></td>
                                <td binding="{'text':'ViewFlag','textHandle':$.MGJ.OrganizationalManage.Bin_ViewFlag}"></td>
                                <td binding="{'text':'PrivinceName,CityName,RegionName','textFormat':'{0}{1}{2}'}"></td>
                                <td binding="{'text':'Address'}"></td>
                                <td binding="{'text':'CreateDate','textHandle':'datetime'}"></td>
                                <td>
                                    <a>编辑</a>
                                    @*<a>删除</a>*@
                                    <a>收发货地址</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-right">
                    <table>
                        <thead>
                            <tr>
                                <th style="padding:6px 15px 7px;">操作</th>
                            </tr>
                        </thead>
                        <tbody id="OMID_right" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo'}">
                            <tr>
                                <td style="padding: 6px 15px 7px;">
                                    <a binding="{'OEID':'ID'}" onclick="$.MGJ.OrganizationalManage.Dialog_EditOrganizational(this,'@ViewBag.eid')">编辑</a>
                                    @*<a binding="{'OEID':'ID'}" onclick="$.MGJ.OrganizationalManage.Ajax_DelOrganizational(this)">删除</a>*@
                                    <a binding="{'OEID':'ID'}" onclick="$.MGJ.OrganizationalManage.Dialog_SendReceiveAddress(this)">收发货地址</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="ShoppingPager"></div>
        </div>
    </div>
</div>

<script>
    $.MGJ.OrganizationalManage.Ajax_GetFormBox("@ViewBag.rid",0, "全部", "");
    var ColspanNub = $(".fixed-table-middle").find("tr").children("td").length
    window.OMID_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';

    $(function () {
        $.MGJ.OrganizationalManage.Ajax_GetOrganizationalInfo(1);
    });
</script>